package com.smartstate.IOC.util;


import java.text.SimpleDateFormat;
import java.util.Date;

public class StringDateUtills {
    private final  static SimpleDateFormat SECOND_STYLE_FORMATOR = new SimpleDateFormat("YYYY-MM-dd hh:mm:ss");
    private final  static SimpleDateFormat DAY_STYLE_FORMATOR = new SimpleDateFormat("YYYY-MM-dd");
    private final  static SimpleDateFormat MONTH_STYLE_FORMATOR = new SimpleDateFormat("YYYY-MM");

    public static String getSecondStyleStrFromDateTime(Date date){
        return  SECOND_STYLE_FORMATOR.format(date);
    }


    public static String getDayStyleStrFromDateTime(Date date){
        return  DAY_STYLE_FORMATOR.format(date);
    }

    public static String getMonthStyleStrFromDateTime(Date date){
        return  MONTH_STYLE_FORMATOR.format(date);
    }
}
